package com.zheng.russiaRec.model 
{
	import com.zheng.utils.DebugTrace;
	import com.zheng.russiaRec.error.GameError;
	import com.zheng.russiaRec.model.vo.VO_App;
	import com.zheng.russiaRec.staticData.StaticData;
	
	import flash.geom.Point;
	
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;
	
	/**
	 * @describe  	系统proxy
	 * @author  	Mr.zheng
	 * @website 	http://blog.sina.com.cn/zihua2007
	 * @time		... 
	 */
	public class P_App extends Proxy implements IProxy
	{
		public static const NAME:String = "M_NAME_APP";
		
		//data.app	系统数据
		public function P_App(data:Object = null) 
		{
			super(NAME, data);
		}
		public function set userOP(value:int):void{
			vo.userOP=value;
		}
		public function set isGamePause(value:Boolean):void 
		{
			vo.isGamePause = value;
		}
		public function set currGameStage(value:String):void 
		{
			vo.currGameStage = value;
		}
		public function get cbP():Point{
			return new Point(vo.cbPX,vo.cbPY);
		}
		public function get gameOverP():Point {
			return new Point(vo.goX, vo.goY);
		}
		public function get scoreP():Point{
			return new Point(vo.scX,vo.scY);
		}
		public function get pauseP():Point { return new Point(vo.pauseX,vo.pauseY); }
		public function get vo():VO_App{
			return data.vo_app as VO_App;
		}
		public function get autoSpeed():int{
			return vo.autoSpeed;
		}
		public function get isGamePause():Boolean { return vo.isGamePause; }
		public function get currGameStage():String { return vo.currGameStage; }
		public function get perExp():String {
			var len:int;
			var str:String = "";
			len = vo.scoreEachCustomsPass.length;
			if(len>=vo.customsPass){
				str = score + "/" + vo.scoreEachCustomsPass[vo.customsPass - 1];
			}else {
				throw new GameError(this+StaticData.E_NOT_LEVELUP_EXP);
			}
			DebugTrace.monsterDebug(this,"得分："+str);
			return str;
		}
		
		public function set score(value:int):void 
		{
			vo.score = value;
		}
		public function get score():int { return vo.score; }
	}
	
}